(function($) {
	$.heartbeat = function(url, times) {
		var h = setInterval(function() {
			heartbeat();
		}, times == undefined ? 3000 : times);
		function heartbeat() {
			$.ajax({
				url : url,
				type : 'post',
				error : function() {
					clearInterval(h);
					console.log('心跳数据发送失败');
				}
			});
		}
	}
})(jQuery);